<?php
/**
 * Created by IDEA.
 * User: ilya
 * Date: 12.10.2010
 * Time: 23:26:24
 */

function processCheckerRequest(CheckerRequest $request) {
    $user_row = RequestUtils::testSession($request->sessionID);

    if ($user_row['user_type'] !== 'SuperAdmin')
        throwBusinessLogicError(0);

    $cur_php_time = getdate();

    $col_value = array(
        'result' => serialize($request->result),
        'test_id' => Data::getUniqueId(),
        'test_time' => DatePHPToMySQL($cur_php_time[0])
    );

    //insert new result in history
    Data::submitModificationQuery(
        Data::composeUpdateQuery(
            'submission_history', $col_value, 'id=' . Data::quote_smart($request->submissionID)
        )
    );

    //return submission result
    $res = new AcceptedResponse();

    return $res;
}

?>